var qiniu = require('qiniu');
var qnConfig = require('./qiniu-config');
qiniu.conf.ACCESS_KEY = qnConfig.ACCESS_KEY;
qiniu.conf.SECRET_KEY = qnConfig.SECRET_KEY;
var mac = new qiniu.auth.digest.Mac(qnConfig.ACCESS_KEY, qnConfig.SECRET_KEY);
var options = {
    scope: qnConfig.Bucket_Name,
    expires: 7200
};
var putPolicy = new qiniu.rs.PutPolicy(options);
var qnToken = putPolicy.uploadToken(mac);
exports.qnToken = qnToken;

exports.getToken = function(){
    return putPolicy.uploadToken(mac);
}
